/* 
 * File:   resource.h
 * Author: bjorn
 *
 * Created on September 3, 2007, 8:46 PM
 */

#ifndef _RESOURCE_H
#define	_RESOURCE_H

#include <stdbool.h>
#include "rope.h"
#include "script.h"
#include "image.h"

#ifdef	__cplusplus
extern "C" {
#endif
    
#ifndef ERUTA_RESOURCE_PATH
    #define ERUTA_RESOURCE_PATH "./share/config.lua:/usr/local/share/eruta/config.lua"
#endif

#ifndef ERUTA_PATH_SEP_STR 
	#define ERUTA_PATH_SEP_STR  ":"
#endif
	
#ifndef ERUTA_PATH_SEP_CHAR
	#define ERUTA_PATH_SEP_CHAR ':'
#endif	

eruta_object(Resource); 

eruta_struct(Resource) {
	Script		script;
	Rope		path;
	Ropelist    directories;
	Rope        config;
}; 


extern bool file_exists(char *filename);

extern Resource resource_free(Resource self); 

extern Resource resource_make(); 

extern Image    resource_loadimage_c(Resource self, char * imagename);


#ifdef	__cplusplus
}
#endif

#endif	/* _RESOURCE_H */

